package com.huawei.M01.iterator.M24;

import java.util.ArrayList;
import java.util.List;
import java.util.StringJoiner;

public class Match {
    public List<Boolean> camelMatch(String[] queries, String pattern) {
        List<Boolean> res = new ArrayList<>(queries.length);
        String str = "[a-z]{0,}";
        StringBuilder sb = new StringBuilder(str);
        for (char c : pattern.toCharArray()) {
            sb.append(c).append(str);
        }
        for (String query : queries) {

            if (query.matches(sb.toString())) {
                res.add(true);
            } else {
                res.add(false);
            }
        }
        return res;
    }

    public static void main(String[] args) {
        System.out.println(new Match().camelMatch(new String[]{"FooBar","FooBarTest","FootBall","FrameBuffer","ForceFeedBack"}, "FoBaT"));
    }
}
